using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Globalization;
using FEL.ACT;
using System.Web.UI.HtmlControls;

public partial class ACT_ACT_ATRIBUTO : PaginaBaseKCG
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string AtributoId = Request.QueryString.Get("Act_Atributo_Id");
            if (AtributoId != null)
            {
                Fv.DefaultMode = FormViewMode.ReadOnly;
                AsignarParametrosDataSourceDeatailsView(AtributoId);
            }
        }
        base.Page_Load(sender, e);
        cargarBotones();
        fvact_atributo.DataBound += new EventHandler(fvact_atributo_DataBound);
    }

    void fvact_atributo_DataBound(object sender, EventArgs e)
    {
        DeshabilitarBotonesEnInsert();
    }
    private void DeshabilitarBotonesEnInsert()
    {
        if (Fv.CurrentMode == FormViewMode.Insert)
        {
            BtnAtributoDet.Enabled = false;            
        }
        else
        {
            BtnAtributoDet.Enabled = true;            
        }
    }
    private void cargarBotones()
    {
        BtnAtributoDet.Text = GetLocalResourceObject("Btn_Act_Atributo_SugerenciaRecursoKCG.Text").ToString();
        BtnAtributoDet.ToolTip = GetLocalResourceObject("Btn_Act_Atributo_SugerenciaRecursoKCG.ToolTip").ToString();
    }

    protected override CheckBox CbInsertarMemoria
    {
        get { return null; }
    }

    protected override Type TipoObjeto
    {
        get { return typeof(global::Act_Atributo); }
    }

    protected override GridView Gv
    {
        get { return gvact_atributo; }
    }

    protected override FormView Fv
    {
        get { return fvact_atributo; }
    }

    protected override ObjectDataSource OdsGv
    {
        get { return odsgvact_atributo; }
    }

    protected override ObjectDataSource OdsDv
    {
        get { return odsfvact_atributo; }
    }

    protected override Button BResponderZoom
    {
        get { return Seleccionar; }
    }

    protected override Button BRegreso
    {
        get { return Atras; }
    }


    protected override Koala.KoalaWebControls.KFiltro KftFiltro
    {
        get { return kftFiltro; }
    }
    protected override string Contenedor
    {
        get { return "ACT_ATRIBUTO"; }
    }

    protected void nav_Siguiente(object sender, EventArgs e)
    {
        Gv_SelectedIndexChanged(sender, e);
    }
    protected void BtnAtributoDet_Click(object sender, EventArgs e)
    {
        TextBox AtributoId = (TextBox)Fv.FindControl("Id");
        Response.Redirect("~/ACT/ACT_ATRIBUTO_DET.aspx?Act_Atributo_Id=" + AtributoId.Text);        
    }

}
